package com.wiki.gds.base.security.admin.utils;


import com.wiki.gds.base.security.common.model.SecurityMember;
import com.wiki.gds.base.security.common.model.SecurityUser;
import org.springframework.beans.BeanUtils;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;

public class SecurityUtil {

    public static SecurityUser getSecurityUser(){
        SecurityUser securityUser= (SecurityUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return securityUser;
    }

    public static SecurityMember getSecurityMember(){
        SecurityMember securityMember= (SecurityMember) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return securityMember;
    }
}
